Skip to content

fix(modal): missing animated & stretched params #1293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 22, 2018

Conversation

ddfreiling
Copy link
Contributor

PR Checklist

What is the current behavior?

ModalDialogOptions did not include the new animated and stretched params introduced with Nativescript 4.0

What is the new behavior?

ModalDialogOptions now includes optional animated and stretched params

Fixes #1292

No breaking changes, no migration steps.

Question for reviewer

In dialogs.ts parentView is typed as ViewBase, but in my experience was always a View at runtime, is it safe to cast this instead of checking instanceof?

@ns-bot
Copy link

ns-bot commented Apr 20, 2018

Can one of the admins verify this patch?

@ghost ghost added the ♥ community PR label Apr 20, 2018
@manoldonev
Copy link
Contributor

manoldonev commented Apr 24, 2018

@ddfreiling I don't think it was our intention to provide a different API for View/ViewBase.showModal(...) so I streamlined it with NativeScript/NativeScript#5734.

Also, generally there are scenarios where we would like to open a modal view from ViewBase instance (e.g. TabViewItem) but it seems this functionality was not working at the moment -- made a second PR to fix it: NativeScript/NativeScript#5737

Till both PRs are merged and released I would suggest you to replace the snippet

// parentView typed as ViewBase, but only View takes stretched param.
if (parentView instanceof View) {
    parentView.showModal(page, context, closeCallback, fullscreen, animated, stretched);
} else {
    parentView.showModal(page, context, closeCallback, fullscreen, animated);
}

with

// TODO: remove <any> cast after https://github.com/NativeScript/NativeScript/pull/5734 is merged
(<any>parentView).showModal(page, context, closeCallback, fullscreen, animated, stretched);

@ddfreiling
Copy link
Contributor Author

ddfreiling commented May 4, 2018

@manoldonev updated to use new showModal signature

@manoldonev
Copy link
Contributor

@ddfreiling can you use the <any> cast above as thou the PRs are merged they are not public yet (no tns-core-modules official releases):

// TODO: remove <any> cast after https://github.com/NativeScript/NativeScript/pull/5734 is merged
(<any>parentView).showModal(page, context, closeCallback, fullscreen, animated, stretched);

ddfreiling and others added 3 commits May 5, 2018 00:34
showModal with all params has been merged, but awaiting new release of tns-core-modules
@manoldonev manoldonev added this to the 6.0 milestone May 21, 2018
@manoldonev
Copy link
Contributor

test

@manoldonev manoldonev merged commit a9a901b into NativeScript:master May 22, 2018
@ghost ghost removed the in progress label May 22, 2018
@ddfreiling ddfreiling deleted the fix/modal-params branch March 6, 2019 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants